import request from '@/utils/request'

//成为运营商
export function become(data) {
    return request({
        url: '/operator/become',
        headers: {
            isToken: false
        },
        method: 'post',
        data: data
    })
}

//获取信息
export function getInfo(query) {
    return request({
        url: '/operator/get',
        headers: {
            isToken: false
        },
        method: 'get',
        params: query
    })
}

//保存信息
export function saveInfo(data) {
    return request({
        url: '/operator/save',
        headers: {
            isToken: false
        },
        method: 'post',
        data: data
    })
}

//获取资质
export function getQua(query) {
    return request({
        url: '/operator/qua/get',
        headers: {
            isToken: false
        },
        method: 'get',
        params: query
    })
}

//图片上传
export function imgUpload(params) {
    return request({
        url: 'operator/qua/imgUpload',
        headers: {
            isToken: false
        },
        method: 'post',
        params
    })
}

//图片上传
export function imgUploadBase64(params) {
    return request({
        url: 'operator/qua/imgUploadBase64',
        headers: {
            isToken: false
        },
        method: 'post',
        data: params
    })
}

//删除资质
export function delQua(params) {
    return request({
        url: 'operator/qua/del',
        headers: {
            isToken: false
        },
        method: 'post',
        data: params
    })
}


//预览资质
export function previewQua(query) {
    return request({
        url: '/operator/machine/previewQua',
        headers: {
            isToken: false
        },
        method: 'get',
        params: query
    })
}

//预览资质二维码
export function previewQuaQRCode(query) {
    return request({
        url: '/operator/machine/previewQuaQRCode',
        headers: {
            isToken: false
        },
        method: 'get',
        params: query
    })
}

//设备列表
export function machineList(params) {
    return request({
        url: 'operator/machine/list',
        headers: {
            isToken: false
        },
        method: 'get',
        params: params
    })
}

//添加设备
export function machineAdd(params) {
    return request({
        url: 'operator/machine/add',
        headers: {
            isToken: false
        },
        method: 'post',
        data: params
    })
}

//获取设备
export function machineGet(params) {
    return request({
        url: 'operator/machine/get',
        headers: {
            isToken: false
        },
        method: 'get',
        params: params
    })
}

//编辑设备
export function machineEdit(params) {
    return request({
        url: 'operator/machine/edit',
        headers: {
            isToken: false
        },
        method: 'post',
        data: params
    })
}

//获取设备资质
export function machineQuaGet(params) {
    return request({
        url: 'operator/machine/getQua',
        headers: {
            isToken: false
        },
        method: 'get',
        params: params
    })
}

//保存设备资质
export function machineQuaSave(params) {
    return request({
        url: 'operator/machine/addQua',
        headers: {
            isToken: false
        },
        method: 'post',
        data: params
    })
}

//获取设备巡检
export function machinePatrolGet(params) {
    return request({
        url: 'operator/machine/getPatrol',
        headers: {
            isToken: false
        },
        method: 'get',
        params: params
    })
}

//上传设备巡检
export function machinePatrolAdd(params) {
    return request({
        url: 'operator/machine/addPatrol',
        headers: {
            isToken: false
        },
        method: 'post',
        data: params
    })
}

//删除设备巡检
export function machinePatrolDel(params) {
    return request({
        url: 'operator/machine/delPatrol',
        headers: {
            isToken: false
        },
        method: 'post',
        data: params
    })
}

//更新设备巡检
export function machinePatrolUpdate(params) {
    return request({
        url: 'operator/machine/updatePatrol',
        headers: {
            isToken: false
        },
        method: 'post',
        data: params
    })
}

//水电费列表
export function costList(params) {
    return request({
        url: 'operator/machine/cost/list',
        headers: {
            isToken: false
        },
        method: 'get',
        params: params
    })
}

//水电费添加
export function costAdd(params) {
    return request({
        url: 'operator/machine/cost/add',
        headers: {
            isToken: false
        },
        method: 'post',
        data: params
    })
}
export function contractGet(params) {
    return request({
        url: 'operator/machine/contract/get',
        headers: {
            isToken: false
        },
        method: 'get',
        params: params
    })
}
export function contractSave(params) {
    return request({
        url: 'operator/machine/contract/save',
        headers: {
            isToken: false
        },
        method: 'post',
        data: params
    })
}
export function contractUpload(params) {
    return request({
        url: 'operator/machine/contract/upload',
        headers: {
            isToken: false
        },
        method: 'post',
        data: params
    })
}
export function contractDel(params) {
    return request({
        url: 'operator/machine/contract/del',
        headers: {
            isToken: false
        },
        method: 'post',
        data: params
    })
}

